﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
    <title>中伟钢物联内部管理系统登录</title>
    <link rel="stylesheet" href="css/bootstrap.css" type="text/css"/>
    <link rel="stylesheet" href="css/app.css" type="text/css"/>
    <link rel="stylesheet" href="css/less/app.utilities.less" type="text/css"/>
</head>
<body>
<div class="container w-xxl w-auto-xs">
    <a href class="navbar-brand block m-t">中伟钢物联</a>
    <div class="m-b-lg">
        <div class="wrapper text-center">
            <strong>内部管理系统登录</strong>
        </div>
        <form name="form" class="form-validation" onsubmit=" return false">
            <div id="error" class="text-danger wrapper text-center"></div>
            <div class="list-group list-group-sm">
                <div class="list-group-item">
                    <input type="text" placeholder="请输入登录名" class="form-control no-border" required id="username">
                </div>
                <div class="list-group-item">
                    <input type="password" placeholder="请输入密码" class="form-control no-border" required id="password">
                </div>
            </div>
            <button type="submit" data-loading-text="Loading..." class="btn btn-lg btn-primary btn-block">登录</button>
            <div class="line line-dashed"></div>
        </form>
    </div>
    <div class="text-center">
        <p>
            <small class="text-muted">中伟钢物联发展有限公司 版权所有 <br> 豫ICP备14027827号 <br>增值电信业务经营许可证：豫B2-20150034</small>
        </p>
    </div>
    <div class="text-center">
        <p style="width:50%">
            苹果二维码
            <img src="img/ios.png" style="width:200px;height:200px" />
        </p>
        <p style="width:50%">
            安卓二维码<a href="http://www.zwgwl.com:8060/WGWL.apk">点击下载</a>
            <img src="img/android.png" style="width:200px;height:200px" />
        </p>
    </div>
</div>
</body>
<!-- jQuery -->
<script src="vendor/jquery/jquery.min.js"></script>
<!--md5-->
<script src="js/login/md5.js"></script>
<!--loginjs-->
<script src="js/login/login.js"></script>
</html>

<script>
    function login() {
        var $username = $("#username").val();
        var $password = $("#password").val();
        var $salt = $("#salt").val();
        var md5password = b64_md5($salt + $password);
        if ("" == $username) {
            return false;
        }
        if ("" == $password) {
            return false;
        }
        $.ajax({
            type: "POST",
            url: "api/Login",
            data: { loginName: $username, password: md5Pw, salt: $salt },
            success: function(data) {
                console.log(data);
                if(window.javatojs.SetUser($username,md5Pw)){

                };

//                function GetQueryString(name){
//                    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
//                    var r = window.location.search.substr(1).match(reg);
//                    if(r!=null)return  unescape(r[2]); return null;
//                }
//                var targetUrl = GetQueryString("url");
//                if (targetUrl == null){
//                    location.href = "../../htm/index.html#/app/News/news";
//                }else {
//                    location.href = targetUrl;
//                }
            }
        });
        return false;
    }
</script>